<?php 
/* 
Pizza template for payment modules in admin area.

Copyright (c) 2010 Ingvar Harjaks <ingvarharjaks@gmail.com>
All costs of this development were covered by open source fiendy
company BrightSide OÜ <www.brightside.ee>

Pizza is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Pizza is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Pizza.  If not, see <http://www.gnu.org/licenses/>.
*/
echo $header; ?>
<?php if (isset($error_warning)) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('view/image/payment.png');"><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location='<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_username; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_username" value="<?php echo ${$prefix."_username"}; ?>" />
            <?php if (isset($error_username)) { ?>
            <span class="error"><?php echo $error_username ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_private_key; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_key_sec" value="<?php echo ${$prefix."_key_sec"}; ?>" />
            <?php if (isset($error_key_sec)) { ?>
            <span class="error"><?php echo $error_key_sec; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_private_key_pw; ?><br /></td>
          <td><input type="password" name="<?php echo $prefix; ?>_key_sec_pw" value="<?php echo ${$prefix."_key_sec_pw"}; ?>" />
	  </td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_public_key; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_key_pub" value="<?php echo ${$prefix."_key_pub"}; ?>" />
            <?php if (isset($error_key_pub)) { ?>
            <span class="error"><?php echo $error_key_pub; ?></span>
            <?php } ?></td>
        </tr>

<?php if ($acc_editable == true) { ?>
	<tr>
          <td><span class="required">*</span> <?php echo $entry_vk_acc; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_vk_acc" value="<?php echo ${$prefix."_vk_acc"}; ?>" />
            <?php if (isset($error_vk_acc)) { ?>
            <span class="error"><?php echo $error_vk_acc; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_vk_name; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_vk_name" value="<?php echo ${$prefix."_vk_name"}; ?>" />
            <?php if (isset($error_vk_name)) { ?>
            <span class="error"><?php echo $error_vk_name; ?></span>
            <?php } ?></td>
        </tr>
<?php } ?>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_bank_url; ?><br /></td>
          <td><input type="text" name="<?php echo $prefix; ?>_bank_url" value="<?php if (strlen(${$prefix."_bank_url"}) != 0) { echo ${$prefix."_bank_url"}; } else { echo $def_bank_url; } ?>" />
            <?php if (isset($error_bank_url)) { ?>
            <span class="error"><?php echo $error_bank_url; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_order_status; ?></td>
          <td><select name="<?php echo $prefix; ?>_order_status_id">
              <?php foreach ($order_statuses as $order_status) { ?>
              <?php if ($order_status['order_status_id'] == ${$prefix."_order_status_id"}) { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select></td>
        </tr>
        <tr>
          <td><?php echo $entry_geo_zone; ?></td>
          <td><select name="<?php echo $prefix; ?>_geo_zone_id">
              <option value="0"><?php echo $text_all_zones; ?></option>
              <?php foreach ($geo_zones as $geo_zone) { ?>
              <?php if ($geo_zone['geo_zone_id'] == ${$prefix."_geo_zone_id"}) { ?>
              <option value="<?php echo $geo_zone['geo_zone_id']; ?>" selected="selected"><?php echo $geo_zone['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $geo_zone['geo_zone_id']; ?>"><?php echo $geo_zone['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select></td>
        </tr>
        <tr>
          <td><?php echo $entry_status; ?></td>
          <td><select name="<?php echo $prefix; ?>_status">
              <?php if (${$prefix."_status"}) { ?>
              <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
              <option value="0"><?php echo $text_disabled; ?></option>
              <?php } else { ?>
              <option value="1"><?php echo $text_enabled; ?></option>
              <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
              <?php } ?>
            </select></td>
        </tr>
        <tr>
          <td><?php echo $entry_sort_order; ?></td>
          <td><input type="text" name="<?php echo $prefix; ?>_sort_order" value="<?php if (isset(${$prefix."_sort_order"})) { echo ${$prefix."_sort_order"}; } ?>" size="1" /></td>
        </tr>
      </table>
    </form>
  </div>
</div>
<?php echo $footer; ?>
